<%@codepage="65001"%> 
<!--#include file="ClassFun.asp"-->
<!--#include file="seeion.asp"-->
<%call chkAdmin("|8") %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>模块管理</title>
<link rel="stylesheet" type="text/css" id="css" href="images/style.css">
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
   <tr>
    <td height="30" class="topnav"><div>模型管理</div></td>
  </tr>
  </tr>
  <tr>
    <td bgcolor="#EBF2F9">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="stable">
<%sql="select * from Channel order by OrderID asc" 
dim rs:Set rs=conn.execute(sql,"r1")
if rs.eof then
echo "<div style=""padding:10px;"">暂无分类!</div>"
end if
while not rs.eof%>
<form action="Admin_Channel.asp?action=Channeledit" method="post" name="edit">
<tr>
<td width="8%" class="td">ID：<%=rs("ChannelId")%><input name="ChannelId" type="hidden"  size="15"  value="<%=rs("ChannelId")%>"/></td>
<td width="13%" height="25" class="td"><input name="ChannelName" class="inp" type="text" size="15"  value="<%=rs("ChannelName")%>"/></td>
<td width="58%" class="td">排序：
<input name="OrderID" type="text" value="<%=rs("OrderID")%>" size="5" class="inp"  /></td>
<td width="8%" class="td"><input type="submit" name="button2" id="button2" value="修 改"  class="btn"/></td>
</tr></form>
 <% 
rs.movenext
wend
rs.close
set rs=nothing%>
          </table>
    </td>
 </tr>
</table>
<div style="margin-top:10px">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<form action="Admin_Channel.asp?action=Channeladd" method="post" name="add">
  <tr>
    <td height="30" class="topnav"><div>增加模型</div></td>
  </tr>
  </tr>
  <tr>
    <td bgcolor="#EBF2F9"><table width="100%" border="0" align="center" cellpadding="5" cellspacing="0" class="stable" >
      <tr>
        <td width="12%" height="25" align="right" class="td">分类名称</td>
        <td width="88%"  class="td"><input name="ChannelName" type="text" size="30" class="btn1"  /></td>
      </tr>
      
      <tr>
        <td width="12%" height="25" align="right" class="td">排序ID</td>
        <td class="td"><input name="OrderID" type="text" value="10" size="30" class="btn1"  /> 
          数字越小越靠前。</td>
      </tr>
      
      <tr>
        <td height="25" align="right" class="td">&nbsp;</td>
        <td class="td"><label>
        <input type="submit" name="button" id="button" value="增加分类"  class="btn"/>
        </label></td>
      </tr>
      
    </table></td>
  </tr></form>
</table>
</div>
<%call Footer%>
</body>
</html>
<% 
if Request.QueryString("action")="Channeladd" then
set rs=server.createobject("adodb.recordset")
sql="select * from Channel"
rs.open sql,conn,1,3
ChannelName=request("ChannelName")
OrderID=request("OrderID")
if ChannelName=""  then 
call alertMsgAndGo("名称不能为空!","-1")
end if
if OrderID=""  then 
call alertMsgAndGo("排序ID不能为空!","-1")
end if
IF not isNumeric(request("Num"))  then
call alertMsgAndGo("错误！排序ID必须为数字!","-1")
end if
rs.addnew
rs("ChannelName")=ChannelName
rs("OrderID")=OrderID
rs.update
rs.close
set rs=nothing
call alertMsgAndGo("分类增加成功!","Admin_Channel.asp")
end if

if Request.QueryString("action")="Channeledit" then
ChannelId=request("ChannelId")
sql="Select * from Channel where ChannelId="&ChannelId
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
IF not isNumeric(request("OrderID")) then
call alertMsgAndGo("排序ID必须为数字!","-1")
end if
rs("ChannelName")=request("ChannelName")
rs("OrderID")=request("OrderID")
rs.update 
rs.close 
call alertMsgAndGo("当前分类修改成功!","Admin_Channel.asp")
end if
%>